#include "StdAfx.h"
#include "Camera.h"


CCamera::CCamera(void)
: m_fFov(45.f)
, m_fFocalLength(FOCAL_LENGTH)
{
}


CCamera::~CCamera(void)
{
}

void CCamera::Init(const CVector3D& vPosition, DATA_TYPE fFov, const CVector3D& vLookAt, const CVector3D& vUp)
{
	SetPosition(vPosition);
	m_fFov = fFov;
	m_vLookAt = vLookAt;
	m_vUp = vUp.Normalize();

	// compute more vectors
	m_vDir = (m_vLookAt - vPosition).Normalize();
	m_vRight = m_vUp.Cross(m_vDir).Normalize();
	m_vUp = m_vDir.Cross(m_vRight).Normalize();
}